package com.hnx.admin.system.service.impl;

import com.hnx.admin.api.log.LogHandler;
import com.hnx.admin.enums.logs.LogType;
import com.hnx.admin.system.domain.param.log.operLog.form.LogForm;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/*
项目名称： core
创 建 人: 倔强的头发
创建日期： 2025/6/9   9:33:32 
描   述：
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class OperationLogHandler implements LogHandler<LogForm> {
    @Override
    public LogType getLogType() {
        return LogType.OPERATION;
    }
    @Override
    @Async("operationExecutor")
    @Transactional(rollbackFor = Exception.class)
    public void asyncSaveLog(LogForm logForm) {
        System.out.println("操作日志记录");
        log.error("操作日志记录");
    }
}
